package experiment5;

public class No_4 {
    public static void main(String []args){
        Car my_car=new Car();
        my_car.weight="80kg";
        my_car.color="red";
        my_car.num_wheel="4";
        System.out.println("weight is "+my_car.getWeight());
        System.out.println("color is "+my_car.getColor());
        System.out.println("the num of wheel is "+my_car.getNum_wheel());

        my_car.speed_Up();
        my_car.speed_Down();
        my_car.stop();
    }
}

class Car{

    //轮胎个数
    String num_wheel;
    //车身颜色
    String color;
    //车身重量
    String weight;
    //车速
    int speed=0;

    public Car(){

    }

    public Car(String num_wheel,String color,String weight){
        this.num_wheel=num_wheel;
        this.color=color;
        this.weight=weight;
    }

    public String getNum_wheel(){
        return num_wheel;
    }
    public String getColor(){
        return color;
    }
    public String getWeight(){
        return weight;
    }
    public int getSpeed() {
        return speed;
    }

    public void speed_Up(){
        speed++;
        System.out.println("现在的车速是"+speed);
    }

    public void speed_Down(){
        speed--;
        System.out.println("现在的车速是"+speed);
    }

    public void stop(){
        speed=0;
        System.out.println("现在的车速是"+speed);
    }

    //test
}
